//
//  NSDate+Tool.m
//  SLDemo
//
//  Created by bocai on 2016/12/2.
//  Copyright © 2016年 Heracles. All rights reserved.
//

#import "NSDate+Tool.h"

NSString *const T_DateFormat_yyyy_MM_dd_HH_mm = @"yyyy-MM-dd HH:mm";
NSString *const T_DateFormat_yyyy_MM_dd_HH_mm_ss = @"yyyy-MM-dd HH:mm:ss";

@implementation NSDate (Tool)

- (NSString *)t_stringWithDateFormat:(NSString *)dateFormat
{
    NSDateFormatter *dateFormatter = [NSDateFormatter new];
    dateFormatter.dateFormat = dateFormat ? dateFormat : T_DateFormat_yyyy_MM_dd_HH_mm;
    return [dateFormatter stringFromDate:self];
}

@end
